<?php
namespace app\feedback\model;
use think\Model;
/**
 *
 */
class Feedback extends Model
{
    //返回所有审核表数据
    function showall()
    {
        $res = db('review')->select();
        return $res;
    }
    //修改审核通过后入库

    function uodateintsql($data){
        $we = ['bangdan_id'=>$data['bangdan_id'],'id'=>$data['exist_id']];
        mp($we);
        if(!$we)return 0;
        if($data['bangdan_id']==1){
            db('jiangren')->where($we)->update($data);
            return 1;
        }else if($data['bangdan_id']==2){
            db('pinpai')->where($we)->update($data);
            return 1;
        }else if($data['bangdan_id']==3){
            db('zhenpin')->where($we)->update($data);
            return 1;
        }else{
            return 0;
        }
    } 

    //展示评论
    function comment()
    {
        $res = db('comment')->order('id desc')->select();
        return $res;
    }

    //展示合作提出方
    function cooperation()
    {
        $res = db('cooperation')->order('id desc')->select();
        return $res;
    }
}


 ?>